//
//  HomeSTLPageTableViewCell.m
//  STL_ Animation
//
//  Created by DJtd on 16/4/1.
//  Copyright © 2016年 STL. All rights reserved.
//

#import "HomeSTLPageTableViewCell.h"

@implementation HomeSTLPageTableViewCell


- (void)setHomeModel:(HomePageBaseModel *)homeModel {
    _homeModel = homeModel;
    [self.backImage sd_setImageWithURL:[NSURL URLWithString:homeModel.albumImg] placeholderImage:[UIImage imageNamed:@"homePlace2"]];
    self.topLabel.text = [NSString stringWithFormat:@"  %@", homeModel.title];
    
    self.medLabel.text = [NSString stringWithFormat:@"  %@", homeModel.artistName];
    self.descLabel.text = [NSString stringWithFormat:@"  播放次数:%@", homeModel.totalViews];
}


- (void)awakeFromNib {
    [super awakeFromNib];
#warning bug---1
    self.shareButton.hidden = YES;
    self.layerName = [CAGradientLayer layer];
    
    self.layerName.startPoint = CGPointMake(0, 0);
    self.layerName.endPoint = CGPointMake(0, 1);
    self.layerName.colors = @[(__bridge id)[UIColor clearColor].CGColor,(__bridge id)[UIColor blackColor].CGColor];
    self.layerName.locations = @[@(0.5f),@(1.0f)];
    
    [self.contentView.layer addSublayer:self.layerName];
    
    [self.contentView bringSubviewToFront:self.topLabel];
    [self.contentView bringSubviewToFront:self.medLabel];
    [self.contentView bringSubviewToFront:self.descLabel];
    [self.contentView bringSubviewToFront:self.shareButton];

}

- (void)layoutSubviews {
    [super layoutSubviews];
    self.layerName.frame = CGRectMake(0, 0, BoundsWidth, BoundsHeight);
    
}

- (IBAction)shardAction:(id)sender {
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
